<!DOCTYPE HTML>
<html lang="zh-CN">




<head>
    <meta charset="utf-8">
    <meta name="keywords" content="JavaNote_Spring_Day01, 深度学习 故障诊断 Java">
    <meta name="description" content="河海大学 | 计算机与信息学院 | 信号与信息处理">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>JavaNote_Spring_Day01 | 世庆的博客</title>
    <link rel="icon" type="image/png" href="/shiqing/favicon.png">

    <link rel="stylesheet" type="text/css" href="/shiqing/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/shiqing/css/my.css">

    <script src="/shiqing/libs/jquery/jquery.min.js"></script>

    <script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
<meta name="generator" content="Hexo 6.3.0"></head>




    <body>
        <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/shiqing/" class="waves-effect waves-light">
                    
                    <img src="/shiqing/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">世庆的博客</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shiqing/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/shiqing/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">世庆的博客</div>
        <div class="logo-desc">
            
            河海大学 | 计算机与信息学院 | 信号与信息处理
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shiqing/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/sqtian-hhu/" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/sqtian-hhu/" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

        



<div class="bg-cover pd-header post-cover" style="background-image: url('/shiqing/medias/featureimages/14.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">JavaNote_Spring_Day01</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/shiqing/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/shiqing/tags/Java%E6%A1%86%E6%9E%B6/">
                                <span class="chip bg-color">Java框架</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/shiqing/categories/Java/" class="post-category">
                                Java
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-06-29
                </div>
                

                

                

                

                
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/shiqing/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="Day1"><a href="#Day1" class="headerlink" title="Day1"></a>Day1</h2><p>Spring框架的概述以及spring中基于XML的IOC配置</p>
<p>程序的耦合<br>    耦合：程序的依赖关系<br>        包括：<br>            类之间的依赖<br>            方法间的依赖<br>    解耦：<br>        降低程序间的依赖关系<br>    实际开发中：<br>        应该做到，编译期不依赖，运行时才依赖<br>    解耦的思路：<br>        第一步：使用反射来创建对象，而避免使用new关键字<br>        第二步：通过读取配置文件来获取要创建的对象全限定类名</p>
<span id="more"></span>
<pre><code>创建Bean对象的工厂
Bean：在计算机英语中，有可重用组件的含义
JavaBean：用java编写的可重用组件
    javabean &gt; 实体类
    它就是创建我们的service和dao对象的
    第一个: 需要一个配置文件来配置我们的service和dao
            配置的内容: 唯一标识=全限定类名(key=value)
    第二个: 通过读取配置文件中配置的内容, 反射创建对象
    
    我们的配置文件可以是xml也可以是properties
</code></pre>
<hr>
<p>用工厂模式创建对象<br>&#x2F;**</p>
<ul>
<li><p>创建Bean对象的工厂<br> *&#x2F;<br>public class BeanFactory {</p>
<p> &#x2F;&#x2F;定义一个Properties对象<br> private static Properties properties;</p>
<p> &#x2F;&#x2F;定义一个Map,用于存放我们要创建的对象,我们称之为容器<br> private static Map&lt;String,Object&gt; beans;</p>
<p> &#x2F;&#x2F;使用静态代码块为Properties对象赋值<br> static{<br> try {<br>     &#x2F;&#x2F;实例化对象<br>     properties &#x3D; new Properties();<br>     &#x2F;&#x2F;获取properties文件的流对象<br>     InputStream in &#x3D; BeanFactory.class.getClassLoader().getResourceAsStream(“bean.properties”);<br>     properties.load(in);<br><br>     &#x2F;&#x2F;实例化容器<br>     beans &#x3D; new HashMap&lt;String, Object&gt;();<br><br>     &#x2F;&#x2F;取出配置文件中所有的Key<br>     Enumeration keys &#x3D; properties.keys();<br>     &#x2F;&#x2F;遍历枚举<br>     while(keys.hasMoreElements()){<br>         &#x2F;&#x2F;取出每个key<br>         String key &#x3D; keys.nextElement().toString();<br>         &#x2F;&#x2F;根据key获取value<br>         String beanPath &#x3D; properties.getProperty(key);<br>         &#x2F;&#x2F;反射创建对象<br>         Object value &#x3D; Class.forName(beanPath).newInstance();<br>         &#x2F;&#x2F;把key和value存入容器中<br>         beans.put(key,value);<br>     }<br> } catch (Exception e) {<br>     throw new ExceptionInInitializerError(“初始化properties失败!”);<br> }<br> }</p>
<p> &#x2F;**</p>
<ul>
<li>根据Bean名称获取Bean对象</li>
<li>@param beanName</li>
<li>@return<br>  *&#x2F;</li>
</ul>
</li>
</ul>
<p>&#x2F;&#x2F;	public static Object getBean(String beanName){<br>&#x2F;&#x2F;		Object bean &#x3D; null;<br>&#x2F;&#x2F;<br>&#x2F;&#x2F;		try {<br>&#x2F;&#x2F;			String beanPath &#x3D; properties.getProperty(beanName);<br>&#x2F;&#x2F;			bean &#x3D; Class.forName(beanPath).newInstance();<br>&#x2F;&#x2F;&#x2F;&#x2F;每次都会调用默认构造函数创建对象<br>&#x2F;&#x2F;		} catch (Exception e) {<br>&#x2F;&#x2F;			e.printStackTrace();<br>&#x2F;&#x2F;		}<br>&#x2F;&#x2F;		return bean;<br>&#x2F;&#x2F;	}</p>
<pre><code>/**
 * 静态代码块准备好beans后,每次getBean就简单了
 * 现在是单例对象了
 */

public static Object getBean(String beanName)&#123;
    return beans.get(beanName);
&#125;
</code></pre>
<p>}</p>
<hr>
<p>public class AccountDaoImpl implements IAccountDao{<br>    &#x2F;**<br>     * 账户的持久层实现类<br>     *&#x2F;</p>
<pre><code>public void saveAccount() &#123;
    System.out.println(&quot;保存了账户&quot;);
&#125;
</code></pre>
<h2 id=""><a href="#" class="headerlink" title="}"></a>}</h2><p>&#x2F;**</p>
<ul>
<li>账户的业务层实现类</li>
<li>业务层调用持久层<br> *&#x2F;<br>public class AccountServiceImpl implements IAccountService {</li>
</ul>
<p>&#x2F;&#x2F;	private IAccountDao accountDao &#x3D; new AccountDaoImpl();<br>    private IAccountDao accountDao &#x3D; (IAccountDao) BeanFactory.getBean(“accountDao”);</p>
<p>&#x2F;&#x2F;	private int i &#x3D; 1;&#x2F;&#x2F;变量若定义在方法外面,单例对象不会重置变量,想要i不变,则要定义到方法里</p>
<pre><code>public void saveAccount() &#123;
    int i = 1;//一般应用层和持久层中不需要额外定义的变量
    accountDao.saveAccount();
    System.out.println(i);
    i++;

&#125;
</code></pre>
<p>}</p>
<hr>
<p>&#x2F;**</p>
<ul>
<li><p>模拟一个表现层,用于调用业务层</p>
</li>
<li><p>实际开发中是一个servlet<br> *&#x2F;<br>public class Client {</p>
<p> public static void main(String[] args) {</p>
</li>
</ul>
<p>&#x2F;&#x2F;		IAccountService as &#x3D; new AccountServiceImpl();</p>
<pre><code>    IAccountService as = (IAccountService) BeanFactory.getBean(&quot;accountService&quot;);
    as.saveAccount();
&#125;
</code></pre>
<p>}</p>
<hr>
<p>accountService &#x3D; com.sqtian.service.impl.AccountServiceImpl<br>accountDao &#x3D; com.sqtian.dao.impl.AccountDaoImpl</p>
<h2 id="IOC"><a href="#IOC" class="headerlink" title="IOC"></a>IOC</h2><p>IOC(Inversion of Control): 控制反转, 把创建对象的权力交给框架,是框架的重要特征<br>包括依赖注入和依赖查找<br>明确ioc的作用: 削减计算机程序的耦合(解除我们代码中的依赖关系)</p>
<p>Spring中的IOC</p>
<p>&#x2F;**</p>
<ul>
<li>模拟一个表现层,用于调用业务层</li>
<li>实际开发中是一个servlet</li>
<li>获取spring的IOC核心容器，并根据id获取对象</li>
<li></li>
<li>ApplicationContext的三个常用实现类</li>
<li><pre><code>ClassPathXmlApplicationContext: 它可以加载类路径下的配置文件,要求配置文件必须在类路径下.不在的话加载不了
</code></pre>
</li>
<li><pre><code>FileSystemXmlApplicationContext: 它可以加载磁盘任意路径下的配置文件(必须有访问权限)
</code></pre>
</li>
<li><pre><code>AnnotationConfigApplicationContext: 它是用于读取注解创建容器的
</code></pre>
</li>
<li></li>
<li><pre><code>核心容器的两个接口引发出的问题
</code></pre>
</li>
<li><pre><code>ApplicationContext:   单例对象适用    实际更多采用此接口
</code></pre>
</li>
<li><pre><code>    它在构建核心容器时,创建对象采取的策略是采用立即加载的方式. 只要一读取完配置文件马上就创建配置文件中的配置的对象
</code></pre>
</li>
<li><pre><code>BeanFactory: 	      多例对象适用
</code></pre>
</li>
<li><pre><code>    它在构建核心容器时,创建对象采取的策略是采用延迟加载的方式. 什么时候根据id获取对象了, 什么时候才真正创建对象
</code></pre>
</li>
<li> *&#x2F;<br>public class Client {  public static void main(String[] args) {<br>  &#x2F;&#x2F;1. 获取核心容器对象</li>
</ul>
<p>&#x2F;&#x2F;		ApplicationContext ac &#x3D; new ClassPathXmlApplicationContext(“bean.xml”); &#x2F;&#x2F;更常用<br>&#x2F;&#x2F;		ApplicationContext ac &#x3D; new FileSystemXmlApplicationContext(“D:\IntelliJ IDEACommunity Edition 2019.3.1\com.sqtian.SpringIOC\src\main\resources\bean.xml”);</p>
<pre><code>    //-----------BeanFactory------------
    Resource resource = new ClassPathResource(&quot;bean.xml&quot;);
    BeanFactory factory = new XmlBeanFactory(resource);
    IAccountService as = (IAccountService) factory.getBean(&quot;accountService&quot;);
    IAccountService adao = (IAccountService) factory.getBean(&quot;accountDao&quot;);

    //2. 根据id获取Bean对象
</code></pre>
<p>&#x2F;&#x2F;		IAccountService as &#x3D; (IAccountService) ac.getBean(“accountService”);<br>&#x2F;&#x2F;		IAccountDao adao &#x3D; ac.getBean(“accountDao”,IAccountDao.class);</p>
<p>&#x2F;&#x2F;		as.saveAccount();<br>    }<br>}</p>
<p>bean对象的细节</p>
<?xml version="1.0" encoding="UTF-8"?>
<p><beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd"></p>
<!--    把对象的创建交给spring来管理-->

<pre><code>&lt;bean id=&quot;accountService&quot; class=&quot;com.sqtian.service.impl.AccountServiceImpl&quot;&gt;
    &lt;!-- collaborators and configuration for this bean go here --&gt;
&lt;/bean&gt;
</code></pre>
<!--    spring对bean的管理细节
    1. 创建bean的三种方式
    2. bean对象的作用范围
    3. bean对象的生命周期

    -->

<pre><code>&lt;!--创建bean的三种方式--&gt;

&lt;!--第一种方式：使用默认构造函数创建
    在spring的配置文件中使用bean标签，配以id和class属性后，且没有其他标签时使用第一种。
    若类中没有默认构造函数则对象无法创建--&gt;
&lt;bean id=&quot;accountDao&quot; class=&quot;com.sqtian.dao.impl.AccountDaoImpl&quot;&gt;
    &lt;!-- collaborators and configuration for this bean go here --&gt;
&lt;/bean&gt;

&lt;!--第二种方式： 使用普遍工厂中的方法创建对象（使用某个类中的方法创建对象，并存入spring容器--&gt;
</code></pre>
<!--    <bean id="instanceFactory" class="com.sqtian.factory.instanceFactory"></bean>-->
<!--    <bean id="accountService" factory-bean="instanceFactory" factory-method="getAccountService"></bean>-->


<pre><code>&lt;!--第三种方式：使用工厂中的静态方法创建对象（使用某个类中的静态方法创建对象，并存入spring容器）--&gt;
</code></pre>
<!--    <bean id="accountService" class="com.sqtian.factory.StaticFactory" factory-method="getAccountService"></bean>-->
<pre><code>&lt;!-- more bean definitions go here --&gt;

&lt;!--bean的作用范围调整
    bean标签的scope属性：
        作用：用于指定bean的作用范围
        取值：
            singleton：单例的（默认值）
            prototype：多例的
            request：作用于web应用的请求范围
            session：作用于web应用的会话范围
            global-session：作用于集群环境的会话范围（全局会话范围），当不是集群环境时，它就是session
            
        --&gt;

&lt;!--bean对象的生命周期
    单例对象
        出生：当容器创建时对象出生
        活着：只要容器还在，对象一直活着
        死亡：容器销毁，对象消亡
        总结：单例对象的生命周期和容器相同
    多例对象
        出生：当我们使用对象时spring框架为我们创建
        活着：对象只要是在使用过程中就一直活着
        死亡：当对象长时间不用且没有别的对象引用时，由java的垃圾回收器回收
        
        --&gt;
</code></pre>
</beans>


<hr>
<p>spring中的依赖注入</p>
<pre><code>&lt;!--spring中的依赖注入
    依赖注入：
        Dependency Injection
    IOC的作用：
        降低程序的耦合（依赖关系）
    依赖关系的管理：
        以后都交给spring来维护
    在当前类需要用到其他类的对象，由spring为我们提供，我们只需要在配置文件中说明
    依赖关系的维护：
        就称之为依赖注入
    依赖注入：
        能注入的数据有三类：
            基本类型和String
            其他bean类型（在配置文件中或者注解配置过的bean）
            复杂类型/集合类型
        注入的方式有三种：
            第一种：使用构造函数提供
            第二种：使用set方法提供
            第三种：使用注解提供
--&gt;

&lt;!--构造函数的注入:
        使用标签: constructor-arg
        标签出现的位置: bean标签的内部
        标签中的属性
            type:用于指定要注入的数据的数据类型, 该数据类型也是构造函数中某个或某些参数的类型
            index:用于指定要注入的数据给构造函数中指定索引位置的参数赋值.索引从0开始
            name:用于指定给构造函数中指定名称的参数赋值                 常用的
            ===================以上三个用于指定给构造函数中哪个参数赋值====================================
            value:用于提供基本类型和String类型的数据
            ref:用于指定其他的bean类型数据. 他指的就是在spring的IOC核心容器中出现过的bean对象

        优势:
            在获取bean对象时,注入数据是必须操作,否则对象无法创建成功
        弊端:
            改变了bean对象的实例化方式,使我们在创建对象时,如果用不到这些数据,也必须提供

        --&gt;
&lt;bean id=&quot;accountService&quot; class=&quot;com.sqtian.service.impl.AccountServiceImpl&quot;&gt;
</code></pre>
<!--        <constructor-arg type="java.lang.String" value="test"></constructor-arg>-->
<pre><code>    &lt;constructor-arg name=&quot;name&quot; value=&quot;test&quot;&gt;&lt;/constructor-arg&gt;
    &lt;constructor-arg name=&quot;age&quot; value=&quot;18&quot;&gt;&lt;/constructor-arg&gt;
    &lt;constructor-arg name=&quot;birthday&quot; ref=&quot;now&quot;&gt;&lt;/constructor-arg&gt;

&lt;/bean&gt;

&lt;!--配置一个日期对象--&gt;
&lt;bean id=&quot;now&quot; class=&quot;java.util.Date&quot;&gt;&lt;/bean&gt;


&lt;!--set方法注入                 更常用
    涉及的标签: property
    出现位置: bean标签内部
    标签属性:
        name:用于指定注入时所调用的set方法名称                 常用的
        value:用于提供基本类型和String类型的数据
        ref:用于指定其他的bean类型数据. 他指的就是在spring的IOC核心容器中出现过的bean对象

    优势:
        创建对象时没有明确的限制,可以直接使用默认构造函数
    弊端:
        如果有某个成员必须有值,则获取对象时有可能set方法没有执行

--&gt;
&lt;bean id=&quot;accountService2&quot; class=&quot;com.sqtian.service.impl.AccountServiceImpl2&quot;&gt;
    &lt;property name=&quot;name&quot; value=&quot;TEST&quot;&gt;&lt;/property&gt;
    &lt;property name=&quot;age&quot; value=&quot;21&quot;&gt;&lt;/property&gt;
    &lt;property name=&quot;birthday&quot; ref=&quot;now&quot;&gt;&lt;/property&gt;

&lt;/bean&gt;


&lt;!--复杂类型/集合类型的注入
    用于给List结构集合注入的标签:
        list array set
    用于给Map结构集合注入的标签:
        map props
    结构相同,标签可以互换

--&gt;
&lt;bean id=&quot;accountService3&quot; class=&quot;com.sqtian.service.impl.AccountServiceImpl3&quot;&gt;
    &lt;property name=&quot;myStrs&quot;&gt;
        &lt;array&gt;
            &lt;value&gt;AAA&lt;/value&gt;
            &lt;value&gt;BBB&lt;/value&gt;
            &lt;value&gt;CCC&lt;/value&gt;
        &lt;/array&gt;
    &lt;/property&gt;

    &lt;property name=&quot;myList&quot;&gt;
        &lt;list&gt;
            &lt;value&gt;AAA&lt;/value&gt;
            &lt;value&gt;BBB&lt;/value&gt;
            &lt;value&gt;CCC&lt;/value&gt;
        &lt;/list&gt;
    &lt;/property&gt;

    &lt;property name=&quot;mySet&quot;&gt;
        &lt;set&gt;
            &lt;value&gt;AAA&lt;/value&gt;
            &lt;value&gt;BBB&lt;/value&gt;
            &lt;value&gt;CCC&lt;/value&gt;
        &lt;/set&gt;
    &lt;/property&gt;

    &lt;property name=&quot;myMap&quot;&gt;
        &lt;map&gt;
            &lt;entry key=&quot;testA&quot; value=&quot;aaa&quot;&gt;&lt;/entry&gt;
            &lt;entry key=&quot;testB&quot;&gt;
                &lt;value&gt;BBB&lt;/value&gt;
            &lt;/entry&gt;
        &lt;/map&gt;
    &lt;/property&gt;

    &lt;property name=&quot;myProps&quot;&gt;
        &lt;props&gt;
            &lt;prop key=&quot;testC&quot;&gt;ccc&lt;/prop&gt;
            &lt;prop key=&quot;testD&quot;&gt;ddd&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;

&lt;/bean&gt;
</code></pre>
<hr>
<p>public class AccountServiceImpl2 implements IAccountService {</p>
<pre><code>//如果是经常变化的数据，并不适用于注入的方式

private String name;
private Integer age;
private Date birthday;

public void setName(String name) &#123;
    this.name = name;
&#125;

public void setAge(Integer age) &#123;
    this.age = age;
&#125;

public void setBirthday(Date birthday) &#123;
    this.birthday = birthday;
&#125;
//	private IAccountDao accountDao = new AccountDaoImpl();

public void saveAccount() &#123;
</code></pre>
<p>&#x2F;&#x2F;		accountDao.saveAccount();<br>        System.out.println(“service中的saveAccount方法执行了。。。”+name+”,”+age+”,”+birthday);</p>
<pre><code>&#125;
</code></pre>
<p>}</p>
<hr>
<p>public class AccountServiceImpl3 implements IAccountService {</p>
<pre><code>//如果是经常变化的数据，并不适用于注入的方式

private String[] myStrs;
private List&lt;String&gt; myList;
private Set&lt;String&gt; mySet;
private Map&lt;String,String&gt; myMap;
private Properties myProps;

public void setMyStrs(String[] myStrs) &#123;
    this.myStrs = myStrs;
&#125;

public void setMyList(List&lt;String&gt; myList) &#123;
    this.myList = myList;
&#125;

public void setMySet(Set&lt;String&gt; mySet) &#123;
    this.mySet = mySet;
&#125;

public void setMyMap(Map&lt;String, String&gt; myMap) &#123;
    this.myMap = myMap;
&#125;

public void setMyProps(Properties myProps) &#123;
    this.myProps = myProps;
&#125;

public void saveAccount() &#123;

    System.out.println(Arrays.toString(myStrs));
    System.out.println(myList);
    System.out.println(mySet);
    System.out.println(myMap);
    System.out.println(myProps);
&#125;
</code></pre>
<p>}</p>
<hr>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/shiqing/about" rel="external nofollow noreferrer">ShiQing</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shiqing.gitee.io/shiqing/2020/06/29/java-kuang-jia/javanote-spring-day01/">https://shiqing.gitee.io/shiqing/2020/06/29/java-kuang-jia/javanote-spring-day01/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/shiqing/about" target="_blank">ShiQing</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/shiqing/tags/Java%E6%A1%86%E6%9E%B6/">
                                    <span class="chip bg-color">Java框架</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/shiqing/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/shiqing/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/shiqing/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/shiqing/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/shiqing/2020/06/29/java-kuang-jia/javanote-spring-day02/">
                    <div class="card-image">
                        
                        
                        <img src="/shiqing/medias/featureimages/15.jpg" class="responsive-img" alt="JavaNote_Spring_Day02">
                        
                        <span class="card-title">JavaNote_Spring_Day02</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            day2spring中基于注解的IOC和ioc的案例

spring中ioc的常用注解

案例使用xml方式和注解方式实现单表的CRUD操作 持久层技术选择：dbutils

改造基于注解的ioc案例，使用纯注解的方式实现 spring的一
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-06-29
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shiqing/categories/Java/" class="post-category">
                                    Java
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shiqing/tags/Java%E6%A1%86%E6%9E%B6/">
                        <span class="chip bg-color">Java框架</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/shiqing/2020/05/13/java-ji-chu/javawebnote06-http/">
                    <div class="card-image">
                        
                        
                        <img src="/shiqing/medias/featureimages/19.jpg" class="responsive-img" alt="&#39;JavaWebNote06_Http&#39;">
                        
                        <span class="card-title">&#39;JavaWebNote06_Http&#39;</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-05-13
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shiqing/categories/Java/" class="post-category">
                                    Java
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shiqing/tags/JavaWeb/">
                        <span class="chip bg-color">JavaWeb</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/shiqing/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/shiqing/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/shiqing/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




        <footer class="page-footer bg-color">
    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2024</span>
            
            <span id="year">2019</span>
            <a href="/shiqing/about" target="_blank">ShiQing</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/blinkfox" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2528393970@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2528393970" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2528393970" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/shiqing/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


        <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/shiqing/search.xml', 'searchInput', 'searchResult');
});
</script>

        <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


        <script src="/shiqing/libs/materialize/materialize.min.js"></script>
        <script src="/shiqing/libs/masonry/masonry.pkgd.min.js"></script>
        <script src="/shiqing/libs/aos/aos.js"></script>
        <script src="/shiqing/libs/scrollprogress/scrollProgress.min.js"></script>
        <script src="/shiqing/libs/lightGallery/js/lightgallery-all.min.js"></script>
        <script src="/shiqing/js/matery.js"></script>

        <!-- Baidu Analytics -->

        <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

        
        <script src="/shiqing/libs/others/clicklove.js" async="async"></script>
        
        
        <script async src="/shiqing/libs/others/busuanzi.pure.mini.js"></script>
        

        <script type="text/javascript">
            var OriginTitile = document.title,
                st;
            document.addEventListener("visibilitychange", function () {
                document.hidden ? (document.title = "看不见我~看不见我~", clearTimeout(st)) : (document.title =
                    "(๑•̀ㅂ•́) ✧被发现了～", st = setTimeout(function () {
                        document.title = OriginTitile
                    }, 3e3))
            })
        </script>

        <!-- 背景樱花飘落特效 -->
        
            <script type="text/javascript">
                //只在桌面版网页启用特效
                var windowWidth = $(window).width();
                if (windowWidth > 768) {
                    document.write('<script type="text/javascript" src="/js/xuehuapiaoluo.js"><\/script>');
                }
            </script>
        

        

        


        
        

        

        

        
        <script src="/shiqing/libs/instantpage/instantpage.js" type="module"></script>
        

    </body>

</html>
